package com.itstudio.portal.controller;




import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itstudio.portal.entity.Project;
import com.itstudio.portal.entity.RestResponse;
import com.itstudio.portal.entity.dto.InstitutionsDto;
import com.itstudio.portal.entity.dto.ProjectDto;
import com.itstudio.portal.service.InstitutionsService;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
import java.util.List;

/**
 * (Institutions)表控制层
 *
 * @author zhangzetan
 * @since 2024-11-18 16:13:27
 */
@RestController
@RequestMapping("/api/institutions")
public class InstitutionsController {
    @Autowired
    InstitutionsService institutionsService;

    @GetMapping("/list")
    public RestResponse getList() {
        return institutionsService.getList();
    }
    @DeleteMapping("/delete/{id}")
    public RestResponse deleteinstitutions(@PathVariable Long id){
        return institutionsService.deleteinstitutions(id);
    }
    @PutMapping("/update")
    public RestResponse updateinstitutions(@RequestBody InstitutionsDto institutionsDto, HttpServletRequest request){
        return institutionsService.updateinstitutions(institutionsDto,request);
    }
    @PostMapping("/add")
    public RestResponse addinstitutions(@RequestBody InstitutionsDto institutionsDto,HttpServletRequest request){
        return institutionsService.addinstitutions(institutionsDto,request);
    }
    //前端合作机构修改 数据回显
    @GetMapping("/get/{id}")
    public RestResponse getListById(@PathVariable Long id){
        return institutionsService.getListById(id);
    }
}

